package com.bdqn.entity;

import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import java.util.Date;

// 用户表
public class user {
    private  int id ;   //id
    @NotNull(message = "用户信息不能为空")
    private  String userName; //用户姓名
    private  String userCode; //用户编码
    private  String userPassword; //用户密码
    private  int gender; // 性别  (1女  2男)
    @DateTimeFormat(pattern = "yyyy-MM-dd")   //可以将指定格式转换成date类型   浏览器到后台
    @JSONField(format = "yyyy-MM-dd")   //后台通过fastjson返回数据给前台
    @Past(message = "必须为一个过去的时间")
    private Date birthday;  //出生日期
    private  String phone; //手机号码
    private  String address; //地址
    private  int roleid; //用户角色
    private  int createdBy; //创建者
    private  Date creationDate; //创建时间
    private  int modifyBy; //更新者
    private  Date modifyDate; //更新时间
   //====================================
    private String rolename;   //角色名字
    private Integer count;   //总人数
    private Integer age;    //年龄
    private String IDPICPATH;

    public String getIDPICPATH() {
        return IDPICPATH;
    }

    public void setIDPICPATH(String IDPICPATH) {
        this.IDPICPATH = IDPICPATH;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public String getRolename() {
        return rolename;
    }

    public void setRolename(String rolename) {
        this.rolename = rolename;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public String getUserPassword() {
        return userPassword;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }

    public int getGender() {
        return gender;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public int getRoleid() {
        return roleid;
    }

    public void setRoleid(int roleid) {
        this.roleid = roleid;
    }

    public int getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(int createdBy) {
        this.createdBy = createdBy;
    }

    public Date getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(Date creationDate) {
        this.creationDate = creationDate;
    }

    public int getModifyBy() {
        return modifyBy;
    }

    public void setModifyBy(int modifyBy) {
        this.modifyBy = modifyBy;
    }

    public Date getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(Date modifyDate) {
        this.modifyDate = modifyDate;
    }

    @Override
    public String toString() {
        return "user{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", userCode='" + userCode + '\'' +
                ", userPassword='" + userPassword + '\'' +
                ", gender=" + gender +
                ", birthday=" + birthday +
                ", phone='" + phone + '\'' +
                ", address='" + address + '\'' +
                ", roleid=" + roleid +
                ", createdBy=" + createdBy +
                ", creationDate=" + creationDate +
                ", modifyBy=" + modifyBy +
                ", modifyDate=" + modifyDate +
                ", rolename='" + rolename + '\'' +
                ", count=" + count +
                ", age=" + age +
                ", IDPICPATH='" + IDPICPATH + '\'' +
                '}';
    }
}
